package com.lds.register.center.common.model.appinstance.request;

import com.lds.management.center.common.model.db.OrderBy;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 条件查询 - 请求
 *
 * @author lidongsheng
 * @since 2025-07-16
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Accessors(chain = true)
public class AppInstanceBaseListRequest extends OrderBy implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 应用实例ID
     */
    private Long id;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    private LocalDateTime updateTime;

    /**
     * IP
     */
    private String ip;
    /**
     * 端口
     */
    private Integer port;
    /**
     * 健康状态 1:健康 0:不健康
     */
    private Boolean healthy;
    /**
     * 应用ID
     */
    private Long appId;
    /**
     * 权重
     */
    private Integer weight;
    /**
     * 启用状态 1:启用 2:停用
     */
    private Boolean enabled;

    public void setIp(String ip) {
        this.ip = StringUtils.trimToNull(ip);
    }

}
